﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="Site" table="cmsSite">
    <cache usage="read-write" />
    <id name="ID" type="System.Int32" unsaved-value="0">
      <column name="ID" />
      <generator class="identity" />
    </id>
    <property name="Domain" type="System.String">
      <column name="Domain" not-null="true" />
    </property>
    <property name="Online" type="System.Boolean">
      <column name="Online" not-null="true" />
    </property>
    <property name="RootMediaFolder" type="System.String">
      <column name="RootMediaFolder" not-null="true" />
    </property>
    <property name="NewsletterFolder" type="System.String">
      <column name="NewsletterFolder" />
    </property>
    <property name="NoReplyEmail" type="System.String">
      <column name="NoReplyEmail" />
    </property>
    <bag cascade="all-delete-orphan" inverse="true" name="AliasDomains" table="cmsSiteAliasDomain" mutable="true">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <element type="System.String">
        <column name="AliasDomain" />
      </element>
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="Folders" mutable="true" order-by="Name">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="Folder" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="Stylesheets" mutable="true">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="Stylesheet" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="Pages" mutable="true">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="Page" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="MasterTemplates" mutable="true">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="MasterTemplate" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="DetailTemplates" mutable="true">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="DetailTemplate" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="Content" mutable="true">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="Content" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="Locales" mutable="true">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="Locale" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="Applications" mutable="true">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="Application" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="Categories" mutable="true" order-by="Name asc">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="Category" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="Menus" mutable="true">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="Menu" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="MediaFolders" mutable="true" order-by="Name">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="MediaFolder" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="MediaFiles" mutable="true" order-by="Name">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="MediaFile" />
    </bag>
    <bag cascade="all-delete-orphan" inverse="true" name="RssFeeds" mutable="true" order-by="Name">
      <cache usage="read-write"/>
      <key>
        <column name="SiteID" />
      </key>
      <one-to-many class="RssFeed" />
    </bag>
    <many-to-one class="Locale" name="DefaultLocale">
      <column name="DefaultLocaleID" />
    </many-to-one>
    <many-to-one class="MasterTemplate" name="DefaultMasterTemplate">
      <column name="DefaultMasterTemplateID" />
    </many-to-one>
    <many-to-one class="DetailTemplate" name="DefaultDetailTemplate">
      <column name="DefaultDetailTemplateID" />
    </many-to-one>
    <bag inverse="true" name="Administrators" table="cmsAdministratorAvailableSite" mutable="true">
      <cache usage="read-write" />
      <key column="SiteID" />
      <many-to-many class="Administrator" column="AdministratorID" />
    </bag>
  </class>
</hibernate-mapping>